﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyThuVien;
using QuanLyThuVien.VO;
using QuanLyThuVien.BUS;

namespace QuanLyThuVien
{
    public partial class frmXoaSach : Form
    {
        public frmXoaSach()
        {
            InitializeComponent();
        }

        private void btnHuy_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnXoa_Click(object sender, EventArgs e)
        {

            busSach busSach = new BUS.busSach();
            Sach Sach = new Sach(txtMaSach.Text, "", "", "");
            DataTable dt = busSach.TimSach(Sach);
            if (dt == null || dt.Rows.Count == 0)
            {
                MessageBox.Show("Khong ton tai trong CSDL");
                return;
            }
            busSach.XoaSach(Sach);
        }

    }
}
